home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PROGEDIT
/
3458B.ZIP
/
AMAC44B.ZIP
/
SM.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-04-26
|
3KB
|
94 lines
:SM.BAT Search Only Using MAXFIND MF.EXE 4/17/92
:
:1) SYNTAX: SM.BAT %1 %2 %3
: ┌──────────┘ │ └───────────┐
: (Mode) %1 %2 %3
: Search Text File Name Option
: ---------------- ------------- ---------- -------
: a) Query [ ] [ ] [ ]
: b) Partial Query Search Text [ ] [ ]
: c) Partial Query Search Text [ ] Option
: d) Command line Search Text File Name [ ]
: e) All command line Search Text File Name Option
:
: where: %1 - Search Text
: %2 - File Name, wild cards OK
: %3 - MAXFIND options, no minus
: [ ] - entered at query prompt
:2) Requires MAXFIND, MF.EXE, INPUT.COM and SM.MAC.
:3) File Name wild cards OK.
:
:
:4) MAXFIND options can be input at option prompt or %3, default option "ltn"
:5) set environment variable OPT=off to bypass MAXFIND option query prompt
: set OPT= to *not* bypass MAXFIND Option query prompt.
:
:
:
:*******************************************************************************
:* *
:* Environment Variable Action *
:* --------------------------- ----------------------------------------------- *
:* set opt= does not bypass option query prompt *
:* set opt=off bypasses option query prompt *
:* set srmac= macro files are located in current directory *
:* set srmac=c:\ macro files are located in c:\ directory *
:* *
:*******************************************************************************
:
:
:
:
@echo off
cls
set S~~=%1
set file=%2
set option=%3
:
if not "%1" == "" if not "%2" == "" goto 2b
if not "%1" == "" goto 1a
if "%1" == "" echo Search Text: [{Blank} terminates batch file]
INPUT.COM Search Text=/b
if errorlevel=1 goto 6a
set s~~=%ans%
goto 2a
:1a
echo Search Text=%S~~%
:2a
set ans=
if "%2" == "" echo File Name(s): [{Blank} terminates batch file] [File Name(s)] NO [FileList]
INPUT.COM File Name(s)=/b
if errorlevel=1 goto 6a
set file=%ans%
:2b
set ans=
if not "%opt%" == "" goto 2c
if not "%3" == "" goto 2c
echo Option(s): [{Blank}=MAXFIND default "ltn"] [afcwdbsh, no minus]
INPUT.COM Option(s)=/b
set option=%ans%
:2c
:4a
cls
echo Search Text = %S~~%
echo File Name(s) = %file%
echo Option(s) = %option%
MF.EXE %S~~% %file% -ltn%option% >c:\$.ql
set >c:\$
copy c:\$.ql c:\!
Q.EXE c:\! /E%srmac%SM.MAC /L%srmac%SM.MAC
goto 7a
:6a
echo.
echo Search ──INCOMPLETE──
goto 8a
:7a
echo.
echo Search ──Complete──
:8a
echo.